<?php require APP_ROOT.'public/head.php';?>
<div class="page">
    <?php require APP_ROOT.'public/top.php';?>
    <div class="page_banner">
        <img src="<?php $classify=M('classify')->where(array('classify_id'=>204))->find();echo $classify['classify_img'];?>" alt="" />
    </div>
    <div class="home_kf">
        <p>微信客服
            <img src="images/kf.jpg" alt="" class="home_kf_code">
            </p>
    </div>
<style>
.home_kf_code{display: none;}
.home_kf:hover .home_kf_code{display: block;}
</style>
    <div class="page_body body_commodity">
        <div class="commodity_page page_body_content">
            <div class="commodity_page_head">
                <ul class="commodity_page_head_nav">
                    <li class="commodity_page_head_item">选择商品</li>
                </ul>
                <dl class="commodity_page_head_condition">
                    <dt>
                        排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序：
                    </dt>
                    <dd class="condition_active bianshd zhohes">
                        综合排序
                    </dd>
                    <dd class="bianshd jiegdes" data-id="0">
                        <span class="jiudnea">价格从高到低</span>
                        <i class="huvdgya el-icon--right el-icon-arrow-down"></i>
                    </dd>
                </dl>
            </div>
            <div class="commodity_page_body">
                <ul id="link_content" class="commodity_list">
                   <!-- <li class="commodity_list_item">
                        <div class="commodity_list_item_shade">
                            <span class="commodity_list_item_shade_but">购买</span>
                        </div>
                        <img src="http://ailipin.top/business/upload/goods/yz.jpg" alt="商品图片" />
                        <p class="commodity_list_item_msg">
                            <span class="commodity_list_item_price">2.9</span>
                            <span class="commodity_list_item_weight">包邮</span>
                        </p>
                        <h6 class="commodity_list_item_title">邮政随机小礼品</h6>
                        <p class="commodity_list_item_number">
                            <span class="commodity_list_item_number_express">邮政快递包裹</span>
                            <span class="commodity_list_item_number_but">购买</span></p>
                    </li>-->
                </ul>

                <div id="products_pages" class="table_pagination el-pagination">

                </di/v>


            </div>
        </div>
    </div>
<style>
    <style>
    .table_pagination { clear: both; margin-top: 30px; margin-bottom: 30px; overflow: hidden; }
    .table_pagination a { float: left; font-size: 12px; margin-right: 10px; line-height: 24px; height: 24px; border: 1px solid #ccc; color: #f40; padding: 0px 8px; border-radius: 2px;text-decoration: none;}
    .table_pagination span {  font-size: 12px; margin-right: 10px; line-height: 24px; height: 24px; padding: 0px 8px; border-radius: 2px; }
    .table_pagination p { float: left; font-size: 12px; margin-right: 10px; line-height: 24px; height: 24px; padding: 0px 8px; border-radius: 2px; }
    .table_pagination .btn_s { display: block; background: #f40; padding-left: 15px; padding-right: 15px; border: 0px; float: left; line-height: 25px; height: 25px; color: #fff; cursor: pointer; }
    .list-main { background: url(../images/list-icon.png) no-repeat 20px center; background-color: #ddddde; margin-bottom: 1px; }
    .del { position: absolute; top: 0; right: 0; display: none; width: 20px; height: 20px; background: url(../images/remv.png) no-repeat 0 0; }
</style>

        <script>
            function link_ajax(){
                $.ajax({
                    url : "index.php?m=goods&a=query",
                    type : "POST",
                    data : {classify:classify,jiegdes:jiegdes,nsduia:nsduia,},
                    success : function(data) {
                        $('#link_content').html(data);
                        window.xing='';
                        link_fenye();
                    }
                });
            }
            var classify='207';//大分类
            var jiegdes='date';//名称
            var nsduia='desc';//顺序
            $('.zhohes').click(function(){
                $('.bianshd').removeClass('condition_active');
                $(this).addClass('condition_active');
                window.jiegdes='date';
                window.nsduia="desc";
                link_ajax();
            });
            $('.jiegdes').click(function(){
                var hid=$(this).attr('data-id');
                if(hid==0){
                    $(this).attr('data-id',1);
                    $(this).find('.huvdgya').removeClass('el-icon-arrow-up');
                    $(this).find('.huvdgya').addClass('el-icon-arrow-down');
                    $(this).find('span').html("价格从高到低");
                    window.nsduia="desc";
                }else if(hid==1){
                    $(this).attr('data-id',2);
                    $(this).find('.huvdgya').removeClass('el-icon-arrow-down');
                    $(this).find('.huvdgya').addClass('el-icon-arrow-up');
                    $(this).find('span').html("价格从低到高");
                    window.nsduia="asc";
                }else if(hid==2){
                    $(this).attr('data-id',1);
                    $(this).find('.huvdgya').removeClass('el-icon-arrow-up');
                    $(this).find('.huvdgya').addClass('el-icon-arrow-down');
                    $(this).find('span').html("价格从高到低");
                    window.nsduia="desc";
                }
                $('.bianshd').removeClass('condition_active');
                $(this).addClass('condition_active');
                window.jiegdes='price';
                link_ajax();
            });

            link_ajax();
        </script>
        <script>
            function link_fenye(){
                $.ajax({
                    url : "index.php?m=goods&a=fenye",
                    type : "GET",
                    success : function(data) {
                        $('#products_pages').html(data);
                    }
                });
            }
            function changepage(id){
                $.ajax({
                    url : "index.php?m=goods&a=query&p="+id,
                    type : "POST",
                    data : {classify:classify,jiegdes:jiegdes,nsduia:nsduia,},
                    success : function(data) {
                        $('#link_content').html(data);
                        window.xing='';
                        link_fenye();
                    }
                });
            }
        </script>

    <div class="recharge" style="display: none;">
        <div class="el-dialog__wrapper" style="display: none;">
            <div role="dialog" aria-modal="true" aria-label="充值" class="el-dialog" style="margin-top: 15vh; width: 460px;">
                <div class="el-dialog__header">
                    <span class="el-dialog__title">充值</span>
                    <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
                </div>
                <!---->
                <!---->
            </div>
        </div>
    </div>
</div>

<div  class="el-message-box__wrapper" style="z-index: 2008;display: none;">
<div class="el-message-box">
<div class="el-message-box__header">
<div class="el-message-box__title tishibt"><span>确定要购买——邮政随机小礼品？</span></div>
<button type="button" aria-label="Close" class="el-message-box__headerbtn"><i class="el-message-box__close el-icon-close dhsui1"></i></button>
</div>
<div class="el-message-box__content">
<div class="el-message-box__container"></div>
<div class="el-message-box__input" style="display: none;">
<div class="el-input"><input type="text" id="goodsid" autocomplete="off" placeholder="" class="el-input__inner"></div>
<div class="el-message-box__errormsg" style="visibility: hidden;"></div>
</div>
</div>
<div class="el-message-box__btns">
    <button type="button" class="el-button el-button--default el-button--small dhsui1"><span>取消</span></button>
    <button type="button" class="el-button el-button--default el-button--small el-button--primary xhsdutiy"><span>购买这件商品</span></button>
</div>
</div>
</div>
<div class="v-modal dhsui1" tabindex="0" style="z-index: 2007;display: none;"></div>
<script>
    function goumai(id,obj) {
        $('.el-message-box__wrapper').css('display','block');
        $('.v-modal').css('display','block');
        $('.tishibt').html('确定要购买——'+obj);
        $('#goodsid').val(id);
    }
    $('.xhsdutiy').click(function(){
        var id=$('#goodsid').val();
        var url="index.php?m=Index&a=chusdhua";
        var data={
            'data1':id,
        }
        $.post(url,data,function(d){
             window.location.href="?m=order&a=tianxie&shu=2";
        });
    });
    $('.dhsui1').click(function() {
        window.location.reload();
    });
</script>
    <div class="recharge" style="display:none;">
        <div class="el-dialog__wrapper" style="z-index: 2020;">
            <div role="dialog" aria-modal="true" aria-label="充值" class="el-dialog" style="margin-top: 15vh; width: 460px;">
                <div class="el-dialog__header">
                    <span class="el-dialog__title">充值</span>
                    <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="dhsui1 el-dialog__close el-icon el-icon-close"></i></button>
                </div>
                <div class="el-dialog__body">
                    <div class="recharge_head">
                        <p><span class="recharge_head_name">平台持卡人姓名：</span><span class="recharge_head_value"><?php echo $site['kaname'];?></span></p>
                        <p><span class="recharge_head_name">平台卡号：</span><span class="recharge_head_value"><?php echo $site['pinkahao'];?></span></p>
                        <p><span class="recharge_head_name">平台银行名称：</span><span class="recharge_head_value"><?php echo $site['pinyinhan'];?></span></p>
                    </div>
                    <form id="fjwues2" class="el-form recharge_form">
                        <div class="el-form-item">
                            <div class="el-form-item__content">
                                <div role="radiogroup" class="el-radio-group">
                                    <label role="radio" tabindex="-1" class="el-radio-button  is-active" border=""><input type="radio" tabindex="-1" class="el-radio-button__orig-radio" name="data[chonzhi_price]"  checked="checked" value="200" /><span class="el-radio-button__inner">200元</span></label>
                                    <label role="radio" tabindex="-1" class="el-radio-button" border=""><input type="radio" tabindex="-1" class="el-radio-button__orig-radio" name="data[chonzhi_price]" value="500" /><span class="el-radio-button__inner">500元</span></label>
                                    <label role="radio" tabindex="-1" class="el-radio-button" border=""><input type="radio" tabindex="-1" class="el-radio-button__orig-radio" name="data[chonzhi_price]" value="1000" /><span class="el-radio-button__inner">1000元</span></label>
                                    <label role="radio" tabindex="-1" class="el-radio-button" border=""><input type="radio" tabindex="-1" class="el-radio-button__orig-radio" name="data[chonzhi_price]" value="2000" /><span class="el-radio-button__inner">2000元</span></label>
                                    <label role="radio" tabindex="-1" class="el-radio-button"><input type="radio" tabindex="-1" class="el-radio-button__orig-radio" name="data[chonzhi_price]" value="5000" /><span class="el-radio-button__inner" style="padding: 12px 16px;">5000元</span></label>
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item">
                            <label class="el-form-item__label">* 银行名称</label>
                            <div class="el-form-item__content">
                                <div class="el-input el-input--small">
                                    <input type="text" name="data[chonzhi_name]" id="chonzhi_name" autocomplete="off" placeholder="你转账银行名称" class="el-input__inner" />
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item">
                            <label class="el-form-item__label">* 银行卡号(卡号后四位)</label>
                            <div class="el-form-item__content">
                                <div class="el-input el-input--small">
                                    <input type="text" name="data[chonzhi_card]" id="chonzhi_card" autocomplete="off" placeholder="你转账的银行卡号后四位" class="el-input__inner" />
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item">
                            <label class="el-form-item__label">* 持卡人姓名</label>
                            <div class="el-form-item__content">
                                <div class="el-input el-input--small">
                                    <input type="text" name="data[chonzhi_xinm]" id="chonzhi_xinm" autocomplete="off" placeholder="请输入持卡人姓名" class="el-input__inner" />
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item">
                            <label class="el-form-item__label">* 充值手机号</label>
                            <div class="el-form-item__content">
                                <div class="el-input el-input--small">
                                    <input type="text" name="data[chonzhi_phone]" id="chonzhi_phone" autocomplete="off" placeholder="请输入你要充值的手机号" class="el-input__inner" />
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item">
                            <label class="el-form-item__label">备注</label>
                            <div class="el-form-item__content">
                                <div class="el-textarea">
                                    <textarea autocomplete="off" name="data[chonzhi_intro]" placeholder="请输入备注内容" class="el-textarea__inner" style="min-height: 54px; height: 54px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="el-form-item recharge_footer">
                            <div class="el-form-item__content">
                                <button type="button" id="tijisdo2" class="el-button el-button--primary"><span>提交</span></button>
                                <button type="button" class="dhsui1 el-button el-button--default"><span>取消</span></button>
                            </div>
                        </div>
                    </form>
                </div>
                <!---->
            </div>
        </div>
    </div>
    <script>
        $('.chongzhian').click(function () {
            $('.v-modal').css('display','block');
            $('.recharge').css('display','block');
        });
        $('.dhsui1').click(function() {
            window.location.reload();
        });
        $('#tijisdo2').click(function(){
            if($('#chonzhi_name').val()=='' || $('#chonzhi_card').val()=='' || $('#chonzhi_xinm').val()=='' || $('#chonzhi_phone').val()==''){
                alert("地址请填写完整");
                return false;
            }else{
                let formdata = new FormData(fjwues2);
                var url="index.php?m=chonzhi&a=add_save";
                $.ajax({
                    type:'post',
                    url:url,
                    data:formdata,
                    cache:false,
                    processData:false,
                    contentType:false,
                    success(res){
                        alert(res);
                        window.location.reload();
                    }
                });
            }
        });
    </script>


</body>
</html>